<?php
declare (strict_types = 1);

namespace app\admin\controller;

use app\common\controller\AdminController;
use app\api\model\Collect as CollectModel;
use app\common\utils\JsonResponse;
use think\facade\Request;

class Collect extends AdminController
{
    /**
     * 获取收藏列表
     */
    public function list()
    {        
        try {
            // $userId = Request::param('user_id/d', 0);
            $page = Request::param('page/d', 1);
            $limit = Request::param('limit/d', 10);

            // if ($userId <= 0) {
            //     return JsonResponse::error('用户ID无效');
            // }

            $result = CollectModel::getList(0, $page, $limit);

            return JsonResponse::success($result);
        } catch (\Exception $e) {
            return JsonResponse::error($e->getMessage());
        }
    }

} 